import type { Metadata } from "next"; import Link from "next/link"; import { getLocale } from "@/lib/i18n/server"; import { href, t } from "@/lib/i18n"; import { methodsWithCounts } from "@/lib/papers/queries"; export const revalidate = 300; export async function generateMetadata(): Promise { const d = t(await getLocale()); return { title: d.methods.title, description: d.methods.lead, alternates: { canonical: "/methods" } }; } export default async function MethodsPage() { const locale = await getLocale(); const d = t(locale); const rows = await methodsWithCounts(); const cats = [...new Set(rows.map((r) => r.category))]; return (

{d.methods.title}

{d.methods.lead}

{cats.map((c) =>

{c}

    {rows.filter((r) => r.category === c).map((m) =>
  • {locale === "fr" ? m.name_fr : m.name_en}

    {m.n} {m.n === 1 ? d.topics.paper : d.topics.papers}

    {(m.papers as { slug: string; identifier: string }[]).slice(0, 8).map((p) => {p.identifier})}

  • )}
)}
); }